StringLength Routine ---------------------------------------------------------------------------- Action Used in mixed-language programming to return the length of a variable-length string. Syntax length = StringLength( string-descriptor%); Remarks The syntax above is for the C language. For MASM, Pascal, and FORTRAN examples, see Chapter 13, "Mixed-Language Programming with Far Strings" in the Programmer's Guide. A non-BASIC routine uses StringLength to return the number of characters in a BASIC variable-length string. Calls to the StringLength routine are usually made from a non-BASIC routine. The argument string-descriptor% is an integer that is the near address of a string descriptor within a non-BASIC routine. As an example, assume that a MASM routine takes a pointer to a string descriptor as a parameter. MASM can find the length of the string data with the following code. movax, psdparm; offset of descriptor pushax extrnstringlength. proc far callstringlength The length of the string is returned in AX. Note If you are not doing mixed-language programming, there is usually no reason to use StringLength. Instead, use LEN to find the length of a variable-length string. For more information on mixed-language programming with strings, see Chapter 12, "Mixed-Language Programming" and Chapter 13, "Mixed-Language Programming with Far Strings" in the Programmer's Guide. See Also L EN, StringAddress, StringAssign, StringRelease Example See the StringAddress routine programming example, which uses the StringLength routine.